package librus.cheeseChaser.util
{
	import flash.geom.Point;

	public class Util
	{
		
		public static function pos2Str(value:Point):String
		{
			return value.x+";"+value.y;
		}
		
		public static function str2Pos(value:String):Point
		{
			var a:Array = value.split(";");
			return new Point(Number(a[0]), Number(a[1]));
		}
		
		public static function shuffleArray(a:Array):Array
		{
			var length:Number = a.length;			
			var b:Array = a.slice();
			var randomNum:Number = Math.random();
			var tmp:Object;
			
			for (var i:int=0;i< length;i++)
			{
				tmp = b[i];
				randomNum = Math.floor(i + (length-i)*Math.random());
				b[i] = b[randomNum];
				b[randomNum]  =tmp;
			}			
			return b;
		}		
	}
}